<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改会员等级')" />
	<style>
		.file {
			position: relative;
			display: inline-block;
			background: #D0EEFF;
			border: 1px solid #99D3F5;
			border-radius: 4px;
			padding: 4px 12px;
			overflow: hidden;
			color: #1E88C7;
			text-decoration: none;
			text-indent: 0;
			line-height: 20px;
		}
		.file input {
			position: absolute;
			font-size: 100px;
			right: 0;
			top: 0;
			opacity: 0;
		}
		.file:hover {
			background: #AADFFD;
			border-color: #78C3F3;
			color: #004974;
			text-decoration: none;
		}
		.showImg{
			width: 100px;
			height: 100px;
			border: 1px solid #ccc;
		}
	</style>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-userLevelConfig-edit" th:object="${userLevelConfig}">
            <input id="levelId" name="levelId" th:field="*{levelId}"  type="hidden">
			<div class="form-group">
				<label class="col-sm-3 control-label">VIP等级：</label>
				<div class="col-sm-8">
					<input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">
				</div>
			</div>
<!--			<div class="form-group">	-->
<!--				<label class="col-sm-3 control-label">等级名称：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="levelName" name="levelName" th:field="*{levelName}" class="form-control" type="text">-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class="form-group">	-->
<!--				<label class="col-sm-3 control-label">升级所需下线：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="needCount" name="needCount" th:field="*{needCount}" class="form-control" type="text">-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class="form-group">-->
<!--				<label class="col-sm-3 control-label">每天最大佣金比例：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="commissionPercentDay" placeholder="如：0.025" name="commissionPercentDay" th:field="*{commissionPercentDay}" class="form-control" type="text">-->
<!--				</div>-->
<!--			</div>-->
			<div class="form-group">
				<label class="col-sm-3 control-label">抢单佣金比例：</label>
				<div class="col-sm-8">
					<input id="grabbingPercent" placeholder="如：0.025" name="commissionPercentDay" th:field="*{grabbingPercent}" class="form-control" type="text">
				</div>
			</div>
<!--			<div class="form-group">-->
<!--				<label class="col-sm-3 control-label">每天最大抢单数：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="billCoutDay" name="billCoutDay" class="form-control" type="text"  th:field="*{billCoutDay}" >-->
<!--				</div>-->
<!--			</div>-->
			<div class="form-group">
				<label class="col-sm-3 control-label">每天任务单数：</label>
				<div class="col-sm-8">
					<input id="taskNum" name="taskNum" class="form-control" type="text"  th:field="*{taskNum}" >
				</div>
			</div>
<!--			<div class="form-group">-->
<!--				<label class="col-sm-3 control-label">vip有效期：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="billCoutDay" name="billCoutDay" class="form-control" type="text" th:field="*{billCoutDay}" >-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class="form-group">-->
<!--				<label class="col-sm-3 control-label">每单佣金：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="perAmount" name="perAmount" th:field="*{perAmount}" class="form-control" type="text">-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class="form-group">	-->
<!--				<label class="col-sm-3 control-label">升级所需余额：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="needBalance" name="needBalance" th:field="*{needBalance}" class="form-control" type="text">-->
<!--				</div>-->
<!--			</div>-->
			<div class="form-group">	
				<label class="col-sm-3 control-label">提现手续费：</label>
				<div class="col-sm-8">
					<input id="cashOutFee" name="cashOutFee" th:field="*{cashOutFee}" class="form-control" type="text">
				</div>
			</div>
<!--			<div class="form-group">	-->
<!--				<label class="col-sm-3 control-label">平台名称：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="platformName" name="platformName" th:field="*{platformName}" class="form-control" type="text">-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class="form-group">-->
<!--				<label class="col-sm-3 control-label">图片：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<div class="showImg">-->
<!--						<img id="previewImg" style="height: 90px;width: 90px;" src=""/>-->
<!--					</div>-->
<!--					<a href="javascript:;" class="file">选择文件-->
<!--						<input id="_imgUrl" name="_imgUrl" type="file">-->
<!--					</a>-->
<!--					<input id="url" th:field="*{url}" name="url" class="form-control" type="hidden">-->
<!--				</div>-->
<!--			</div>-->
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		// var imgUrl ='[[${userLevelConfig.url}]]';
		// document.getElementById("previewImg").src=imgUrl;
		// $("#_imgUrl").change(function () {
		// 	//创建blob对象，浏览器将文件放入内存中，并生成标识
		// 	var file = $(this)[0].files[0];
		// 	var img_src = URL.createObjectURL(file);
		// 	//给img标检的src赋值
		// 	document.getElementById("previewImg").src=img_src;
		// 	$("#previewImg").css("visibility","visible");
		// 	//URL.revokeObjectURL(img_src);// 手动 回收，
		// 	var data = new FormData();
		// 	data.append("file", file);
		// 	$.ajax({
		// 		type: "POST",
		// 		url: ctx + "common/upload",
		// 		data: data,
		// 		cache: false,
		// 		contentType: false,
		// 		processData: false,
		// 		dataType: 'json',
		// 		success: function(result) {
		// 			if (result.code == web_status.SUCCESS) {
		// 				$.modal.alert('上传成功！');
		// 				$('#url').val( result.url );
		// 			} else {
		// 				$.modal.alertError(result.msg);
		// 			}
		// 		},
		// 		error: function(error) {
		// 			$.modal.alertWarning("图片上传失败。");
		// 		}
		// 	});
		// });

		var prefix = ctx + "channel/userLevelConfig";
		$("#form-userLevelConfig-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-userLevelConfig-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
